package cn.edu.nwsuaf.teachercenter.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Cource entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cource", catalog = "exam")
public class Cource implements java.io.Serializable {

	// Fields

	private String courceNo;
	private String courceName;
	private Float courceScore;
	private Set<ExamPaperInfo> examPaperInfos = new HashSet<ExamPaperInfo>(0);
	private Set<CourceEmployee> courceEmployees = new HashSet<CourceEmployee>(0);
	private Set<ExerciceItem> exerciceItems = new HashSet<ExerciceItem>(0);
	private Set<StudentCourceScore> studentCourceScores = new HashSet<StudentCourceScore>(
			0);
	private Set<StudentCommonScore> studentCommonScores = new HashSet<StudentCommonScore>(
			0);

	// Constructors

	/** default constructor */
	public Cource() {
	}

	/** minimal constructor */
	public Cource(String courceNo, String courceName) {
		this.courceNo = courceNo;
		this.courceName = courceName;
	}

	/** full constructor */
	public Cource(String courceNo, String courceName, Float courceScore,
			Set<ExamPaperInfo> examPaperInfos,
			Set<CourceEmployee> courceEmployees,
			Set<ExerciceItem> exerciceItems,
			Set<StudentCourceScore> studentCourceScores,
			Set<StudentCommonScore> studentCommonScores) {
		this.courceNo = courceNo;
		this.courceName = courceName;
		this.courceScore = courceScore;
		this.examPaperInfos = examPaperInfos;
		this.courceEmployees = courceEmployees;
		this.exerciceItems = exerciceItems;
		this.studentCourceScores = studentCourceScores;
		this.studentCommonScores = studentCommonScores;
	}

	// Property accessors
	@Id
	@Column(name = "cource_no", unique = true, nullable = false, length = 50)
	public String getCourceNo() {
		return this.courceNo;
	}

	public void setCourceNo(String courceNo) {
		this.courceNo = courceNo;
	}

	@Column(name = "cource_name", nullable = false, length = 50)
	public String getCourceName() {
		return this.courceName;
	}

	public void setCourceName(String courceName) {
		this.courceName = courceName;
	}

	@Column(name = "cource_score", precision = 12, scale = 0)
	public Float getCourceScore() {
		return this.courceScore;
	}

	public void setCourceScore(Float courceScore) {
		this.courceScore = courceScore;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cource")
	public Set<ExamPaperInfo> getExamPaperInfos() {
		return this.examPaperInfos;
	}

	public void setExamPaperInfos(Set<ExamPaperInfo> examPaperInfos) {
		this.examPaperInfos = examPaperInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cource")
	public Set<CourceEmployee> getCourceEmployees() {
		return this.courceEmployees;
	}

	public void setCourceEmployees(Set<CourceEmployee> courceEmployees) {
		this.courceEmployees = courceEmployees;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cource")
	public Set<ExerciceItem> getExerciceItems() {
		return this.exerciceItems;
	}

	public void setExerciceItems(Set<ExerciceItem> exerciceItems) {
		this.exerciceItems = exerciceItems;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cource")
	public Set<StudentCourceScore> getStudentCourceScores() {
		return this.studentCourceScores;
	}

	public void setStudentCourceScores(
			Set<StudentCourceScore> studentCourceScores) {
		this.studentCourceScores = studentCourceScores;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cource")
	public Set<StudentCommonScore> getStudentCommonScores() {
		return this.studentCommonScores;
	}

	public void setStudentCommonScores(
			Set<StudentCommonScore> studentCommonScores) {
		this.studentCommonScores = studentCommonScores;
	}

}